<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTopicCommentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('topic_comments', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('member_id')->index()->comment('用户ID');
            $table->integer('topic_id')->index()->comment('帖子ID');
            $table->string('content')->default('')->comment('评论内容');
            $table->integer('fav_count')->default('0')->comment('点赞数');
            $table->tinyInteger('status')->default('0')->comment('状态：0、未审核；1、已通过；2、未通过');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('topic_comments');
    }
}
